home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 476-500 / disk_500 / wiconify / wiconsetter.lzh / wIconSetter / Source / wIconSetup.h < prev    next >
C/C++ Source or Header  |  1991-04-19  |  3KB  |  104 lines

  1. /*
  2.  *  WICONSETTER     A companion utility to wIconify.  wIconSetter allows
  3.  *                  you to specify custom icons for windows ans screens
  4.  *                  that normally use the default icons.
  5.  *
  6.  *  wIconSetup.h    Information shared by the handler and loader.
  7.  *
  8.  *  Copyright 1990 by Davide P. Cervone, all rights reserved.
  9.  *  You may use this code, provided this copyright notice is kept intact.
  10.  */
  11.  
  12. #define PORTNAME        "wIconSetter-Port"      /* Name of the system port */
  13. #define ICONPROCNAME    " wIconify-Handler "    /* the wIconify process */
  14.  
  15. #define WI_AUTOICONIFY      BIT(7)              /* wIconSetter flag only */ 
  16.  
  17. #define MAXNAME         64                      /* longest name allowed */
  18. #define NAME_ANY        ((char *)-1)            /* name is '[ANY]' */
  19. #define NAME_NULL       NULL                    /* name is '[NULL]' */
  20. #define SCREENICON      ((char *)-2)            /* this is a screen icon */
  21.  
  22.  
  23. typedef struct IconWindow ICONDEFINE;
  24. typedef struct IconWindow ICONWINDOW;
  25. typedef struct IconScreen ICONSCREEN;
  26. typedef struct IconProgram ICONPROGRAM;
  27.  
  28.  
  29. #define IconDefine  IconWindow
  30.  
  31.  
  32. /*
  33.  *  The following structures form the linked list of programs, screens,
  34.  *  windows and definititions that determine what windows should get icons.
  35.  */
  36.  
  37. struct IconWindow
  38. {
  39.    ICONWINDOW *Next;                /* Pointer to next window */
  40.    char *Name;                      /* Window's expected title */
  41.    struct Image *Mask;              /* Image structure used to hold the mask */
  42.    WICON Icon;                      /* The icon to apply to this window */
  43.    ULONG Flags;                     /* Flag bits */
  44.      #define IW_IMAGE       BIT(0)      /* An Image was allocated */
  45.      #define IW_SELECT      BIT(1)      /* A Select Image was allocated */
  46.      #define IW_MASK        BIT(2)      /* A Mask Image was allocated */
  47.      #define IW_NAME        BIT(3)      /* An Icon Name was allocated */
  48.      #define IW_ALLOCED     (IW_IMAGE| IW_SELECT| IW_MASK| IW_NAME);
  49. };
  50.  
  51. struct IconScreen
  52. {
  53.    ICONSCREEN *Next;        /* Pointer to next screen */
  54.    char *Name;              /* The screen's expected name */
  55.    ICONWINDOW *Window;      /* The window's on this screen that get icons */
  56. };
  57.  
  58. struct IconProgram
  59. {
  60.    ICONPROGRAM *Next,*Prev;     /* Linked-list and binary-tree pointers */
  61.    char *Name;                  /* The name of the program */
  62.    ICONSCREEN *Screen;          /* The first screen with icons specified */
  63. };
  64.  
  65.  
  66. struct IconHandlerInfo
  67. {
  68.    struct MsgPort IconPort;                 /* port used to store this info */
  69.    short MajVers,MinVers, MinLoadVers;      /* version of handler and loader */
  70.    long Segment;                            /* SegList loaded by loader */
  71.    struct IntuitionBase **IntuitionBase;
  72.    struct SysBase **SysBase;
  73.    
  74.    /*
  75.     *  These are the routines replaced by SetFunction()
  76.     */
  77.    
  78.    void (*aOpenWindow)();
  79.    long *OldOpenWindow;
  80.    void (*aSetWindowTitles)();
  81.    long *OldSetWindowTitles;
  82.    void (*aOpenScreen)();
  83.    long *OldOpenScreen;
  84.  
  85.    /*
  86.     *  These are the structures used for set-up and clean-up
  87.     */
  88.     
  89.    void (*GetProgramName)();
  90.    int  (*PrefixMatch)();
  91.    ICONWINDOW *(*FindIcon)();
  92.    ICONDEFINE  **FirstDefine;
  93.    ICONPROGRAM **FirstProgram;
  94.    ICONPROGRAM **ProgramAny;
  95. };
  96.  
  97.  
  98. /*
  99.  *  Macros to make using IconHandlerInfo easy
  100.  */
  101.  
  102. #define VAR(x)      (*(IconHandlerData->x))
  103. #define var(x)      (IconHandlerData->x)
  104.